/*******************************************************************************
 Configuration Information:
 Repository: Integrity Source
 Name      : $RCSfile: ActiveReturnSwc_calculateDemand.c $
 Version   : $Revision: 1.13 $
 Author    : $Author: Jack Jin (JinC5) $
 Date      : $Date: 2019/03/15 18:35:05IST $
 Location  : $ProjectName: /Steering/Projects/Geely/CMA_DP/PR48756_LVS_ENG_APP_Geely_CMA_EPS_DP_SYS_HRoom_AP/30_Software/3040_Design/S2-Application/01-Development/V00-Mainline/04-Components/ActiveReturn_Ear/Source/project.pj $
********************************************************************************

   ZF Friedrichshafen AG owns the copyright in this document and associated
   documents and all rights are reserved.  These documents must
   not be used for any purpose other than that for which they
   are supplied and must not be copied in whole or in part or
   disclosed to others without prior written consent of ZF Friedrichshafen AG.
   Any copy of this drawing or document made by any method
   must also include a copy of this legend.

   (C) ZF Friedrichshafen AG 2018

*******************************************************************************/
/**************************************************************************************************\
 *** 
 *** Simulink model       : ActiveReturnSwc_calculateDemand_tl
 *** TargetLink subsystem : ActiveReturnSwc_calculateDemand_tl
 *** Codefile             : ActiveReturnSwc_calculateDemand.c
 ***
 *** Generated by TargetLink, the dSPACE production quality code generator
 *** Model version: 1.339
 *** Generation date: 2019-03-15 10:41:03
 ***
 *** CODE GENERATOR OPTIONS:
 *** Code generation mode                     : AUTOSAR
 *** AUTOSAR version                          : 4.2.2
 *** Compiler                                 : <unknown>
 *** Target                                   : Generic
 *** ANSI-C compatible code                   : yes
 *** Code Optimization                        : enabled
 *** Constant style                           : decimal
 *** Clean code option                        : enabled
 *** Logging mode                             : Do not log anything
 *** Code Coverage                            : disabled
 *** Generate empty conditional branches      : disabled
 *** Loop unroll threshold                    : 5
 *** Shift mode                               : automatic
 *** Handle unscaled SF expr. with TL type    : enabled
 *** Assignment of conditions                 : AllBooleanOutputs 
 *** Scope reduction only to function level   : disabled
 *** Exploit ranges if not erasable           : disabled
 *** Exploit Compute Through Overflow         : never
 *** Linker sections                          : enabled
 *** Enable Assembler                         : disabled
 *** Variable name length                     : unlimited
 *** Use global bitfields                     : disabled
 *** Stateflow: use of bitfields              : enabled
 *** State activity encoding limit            : 8
 *** Omit zero inits in restart function      : disabled
 *** Share functions between TL subsystems    : disabled
 *** Generate 64bit functions                 : disabled
 *** Inlining Threshold                       : 6
 *** Line break limit                         : 100
 *** Target optimized boolean data type       : enabled
 *** Keep saturation elements                 : disabled
 *** Extended variable sharing                : disabled
 *** Extended lifetime optimization           : enabled
 *** Style definition file                    : C:\Program Files\dSPACE TargetLink 4.2\Matlab\Tl\Con
 ***                                            fig\codegen\cconfig.xml
 *** Root style sheet                         : C:\Program Files\dSPACE TargetLink 4.2\Matlab\Tl\XML
 ***                                            \CodeGen\Stylesheets\TL_CSourceCodeSS.xsl
 ***
 *** SUBSYS                   CORRESPONDING SIMULINK SUBSYSTEM
 *** SActive_r11              ActiveReturnSwc_calculateDemand_tl
 *** SActive_r12              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand
 *** SActive_r13              ActiveReturnSwc_calculateDemand_tl/DocRunnable
 *** SActive_r14              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/Cal
 ***                          culateRackPosition
 *** SActive_r15              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp1DMapEarActvn
 *** SActive_r16              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp1DMapEarActvnRed
 *** SActive_r17              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp2DMap_EarKp
 *** SActive_r18              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp2DMap_EarRackVDmd
 *** SActive_r19              ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp1DMapEarActvn/SteerFeelSelectionSwc_interpolate1DMap1
 *** SActive_r110             ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 *** _Interp1DMapEarActvn/SteerFeelSelectionSwc_interpolate1DMap1/Interpola
 ***                          teActiveTune
 *** SActive_r111             ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 *** _Interp1DMapEarActvn/SteerFeelSelectionSwc_interpolate1DMap1/Interpola
 ***                          teTargetTune
 *** SActive_r112             ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 ***                          _Interp1DMapEarActvnRed/SteerFeelSelectionSwc_interpolate1DMap1
 *** SActive_r113             ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 *** _Interp1DMapEarActvnRed/SteerFeelSelectionSwc_interpolate1DMap1/Interp
 ***                          olateActiveTune
 *** SActive_r114             ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS
 *** _Interp1DMapEarActvnRed/SteerFeelSelectionSwc_interpolate1DMap1/Interp
 ***                          olateTargetTune
 *** SActive_r115             ActiveReturnSwc_calculateDemand_tl/DocRunnable/EmptySubsystem
 *** 
 *** SUBSYS                   CORRESPONDING MODEL BLOCK (REFERENCED MODEL)
 *** SAR_CD_041               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_ActvnMgr (AR_CD_ActvnMgr_tl)
 *** SAR_CD_051               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_ArCtrlr (AR_CD_ArCtrlr_tl)
 *** SAR_CD_071               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_ColTqFil (AR_CD_ColTqFil_tl)
 *** SAR_CD_091               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_LKAColTqCalc (AR_CD_LKAColTqCalc_tl)
 *** SAR_CD_061               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_RackPosnCtrlErrPrelookup (AR_CD_RackPosnCtrlErrPrelookup_tl)
 *** SAR_CD_031               ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_
 ***                          CD_RackVDmd (AR_CD_RackVDmd_tl)
 *** 
 *** SF-NODE   CORRESPONDING STATEFLOW NODE                           DESCRIPTION
 *** 
 *** TargetLink version      : 4.2p2 from 27-Nov-2017
 *** Code generator version  : Build Id 4.2.0.33 from 2017-11-28 14:39:24

\**************************************************************************************************/

#ifndef ACTIVERETURNSWC_CALCULATEDEMAND_C
#define ACTIVERETURNSWC_CALCULATEDEMAND_C

/*----------------------------------------------------------------------------*\
  DEFINES (OPT)
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  INCLUDES
\*----------------------------------------------------------------------------*/

#include "Rte_ActiveReturnSwc.h"
#include "AR_CD_RackVDmd.h"
#include "AR_CD_RackPosnCtrlErrPrelookup.h"
#include "AR_CD_LKAColTqCalc.h"
#include "AR_CD_ColTqFil.h"
#include "AR_CD_ArCtrlr.h"
#include "AR_CD_ActvnMgr.h"
#include "ActiveReturnSwc_Library.h"
#include "ActiveReturnSwc_calculateDemand.h"

/*----------------------------------------------------------------------------*\
  ENUMS
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  DEFINES
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  TYPEDEFS
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  VARIABLES
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  PARAMETERIZED MACROS
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  FUNCTION PROTOTYPES
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  INLINE FUNCTIONS
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
  FUNCTION DEFINITIONS
\*----------------------------------------------------------------------------*/

/**************************************************************************************************\
 ***  FUNCTION:
 ***      ActiveReturn_calculateDemand
 *** 
 ***  DESCRIPTION:
 ***      This runnable calculates a 'active return torque demand' used to assist the steering wheel
 ***       back to the centre.
 *** 
 ***  PARAMETERS:
 ***      Type               Name                Description
 ***      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ***
 ***  RETURNS:
 ***      void
 ***
 ***  SETTINGS:
 ***
\**************************************************************************************************/
#define ActiveReturnSwc_START_SEC_CODE
#include "ActiveReturnSwc_MemMap.h"

FUNC(void, ActiveReturnSwc_CODE) ActiveReturn_calculateDemand(void)
{
   /* SLLocal: Default storage class for local variables | Width: 32 */
   Float32 ArLimit;
   Float32 ColTrqAtfA1;
   Float32 ColTrqAtfA2;
   Float32 ColTrqAtfB0;
   Float32 ColTrqAtfB1;
   Float32 ColTrqAtfB2;
   Float32 EarLkaSpdFraction_a;
   Float32 EarSpdFraction;

   /* SLLocal: Default storage class for local variables | Width: 8 */
   UInt8 EarLkaSpdIndex_a;
   UInt8 EarSpdIndex;

   /* SLLocal: Default storage class for local variables | Width: N.A. */
   tAssistTorque AssistanceTorque;

   /* SLLocalInit: Default storage class for local variables with init value | Width: 32 */
   Float32 interpolatedTune_a;
   Float32 interpolatedTune_b;
   Float32 interpolatedTune_c;
   Float32 interpolatedTune_d;
   mm rackPosition_a;

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_EarSpdFraction */
   EarSpdFraction = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_EarSpdFraction();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_EarSpdIndex */
   EarSpdIndex = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_EarSpdIndex();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ColTrqAtfA1 */
   ColTrqAtfA1 = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ColTrqAtfA1();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_EarLkaSpdIndex */
   EarLkaSpdIndex_a = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_EarLkaSpdIndex();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_EarLkaSpdFraction */
   EarLkaSpdFraction_a = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_EarLkaSpdFraction();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ColTrqAtfA2 */
   ColTrqAtfA2 = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ColTrqAtfA2();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ColTrqAtfB0 */
   ColTrqAtfB0 = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ColTrqAtfB0();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ArLimit */
   ArLimit = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ArLimit();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ColTrqAtfB1 */
   ColTrqAtfB1 = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ColTrqAtfB1();

   /* TargetLink inport: ActiveReturnSwc_calculateDemand_tl/RV_ColTrqAtfB2 */
   ColTrqAtfB2 = Rte_IrvIRead_ActiveReturnSwc_calculateDemand_ColTrqAtfB2();

   /* ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/Function-Call Generator
      call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/Calculate
      RackPosition
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/SteeringPositionLower */
   Rte_Call_RACK_translateColumnAngleToRackPosition(Rte_IRead_ActiveReturnSwc_calculateDemand_COL_DATA_SteeringPositionLower()->Value,
     &rackPosition_a);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_Rac
      kVDmd
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_DATA_RackVelocity
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_OFFSET_RackCentreOffset
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_OFFSET_RackCentreOffset */
   AR_CD_RackVDmd(Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_OFFSET_RackCentreOffset()->Value,
    Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_OFFSET_RackCentreOffset()->ActiveFlag,
    rackPosition_a, Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_DATA_RackVelocity()->Value);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS_Inter
      p2DMap_EarRackVDmd
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarRackVDmd/MapSizeY
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarRackVDmd/MapSizeX
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarRackVDmd/MapPtr */
   Rte_Call_SFS_BLEND_CP_interpolate2DMap(EarSpdIndex, EarSpdFraction, (uint8)
    VEHICLE_SPEED_BRKPTS_MAP_SIZE, var_AR_CD_RackVDmd.EarRackPosnIndex,
    var_AR_CD_RackVDmd.EarRackPosnFraction, (uint8) EAR_RACK_POSN_BRKPTS_MAP_SIZE, (const Float32 *)
     &(Rte_CData_EAR_RACK_V_DMD_MAP()->TUNE0[0][0]), &interpolatedTune_a);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_Rac
      kPosnCtrlErrPrelookup */
   AR_CD_RackPosnCtrlErrPrelookup(var_AR_CD_RackVDmd.EarRackPosnCtrlErr);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_LKA
      ColTqCalc
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_OP_TRQ_OVLY_OverlayTorqueDemand
    */
   AR_CD_LKAColTqCalc(Rte_IRead_ActiveReturnSwc_calculateDemand_OP_TRQ_OVLY_AssistanceTorque()->Value,
     EarLkaSpdIndex_a, EarLkaSpdFraction_a);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_Col
      TqFil
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/IP_TRQ_OVLY_TorqueDemand
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_COL_DATA_ColumnTorque */
   AR_CD_ColTqFil(Rte_IRead_ActiveReturnSwc_calculateDemand_COL_DATA_ColumnTorque()->Value,
    ColTrqAtfA1, ColTrqAtfA2, ColTrqAtfB0, ColTrqAtfB1, ColTrqAtfB2,
    var_AR_CD_LKAColTqCalc.EarLkaColTq,
    Rte_IRead_ActiveReturnSwc_calculateDemand_IP_TRQ_DMDS_OverlayTorqueDemand()->Value);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS_Inter
      p1DMapEarActvn
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp1DMapEarActvn/MapSize */
   Rte_Call_SFS_BLEND_CT_interpolate1DMap(var_AR_CD_ColTqFil.EarColTqFildIndex,
    var_AR_CD_ColTqFil.EarColTqFildFraction, (uint8) EAR_ACTVN_COL_TQ_BRKPTS_MAP_SIZE, (const
    float32 *) Rte_CData_EAR_ACTVN_MAP()->TUNE0, &interpolatedTune_b);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS_Inter
      p1DMapEarActvnRed
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp1DMapEarActvnRed/MapSize */
   Rte_Call_SFS_BLEND_CT_interpolate1DMap(var_AR_CD_ColTqFil.EarColTqFildIndex,
    var_AR_CD_ColTqFil.EarColTqFildFraction, (uint8) EAR_ACTVN_COL_TQ_BRKPTS_MAP_SIZE, (const
    float32 *) Rte_CData_EAR_ACTVN_RED_MAP()->TUNE0, &interpolatedTune_c);

   /* update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_
      ActvnMgr/EarRackPosnCtrlErrSign */
   var_AR_CD_ActvnMgr.EarRackPosnCtrlErrSign = (float32) var_AR_CD_RackVDmd.EarRackPosnCtrlErrSign;

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_Act
      vnMgr
      # combined # TargetLink inport: ActiveReturnSwc_calculateDemand_tl/R_ARB_RES_ArbitrationState
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_FVS_VehicleSpeed
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_DATA_RackVelocity
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_DATA_RackVelocity
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_COL_DATA_ColumnTorque
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/SteeringPositionLower */
   AR_CD_ActvnMgr(interpolatedTune_a,
    Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_DATA_RackVelocity()->Value,
    Rte_IRead_ActiveReturnSwc_calculateDemand_ARB_RES_ArbitrationState(),
    Rte_IRead_ActiveReturnSwc_calculateDemand_COL_DATA_SteeringPositionLower()->Qf,
    Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_DATA_RackVelocity()->Qf,
    Rte_IRead_ActiveReturnSwc_calculateDemand_FVS_VehicleSpeed()->Qf,
    Rte_IRead_ActiveReturnSwc_calculateDemand_COL_DATA_ColumnTorque()->Qf, interpolatedTune_b,
    interpolatedTune_c);

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/SFS_Inter
      p2DMap_EarKp
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarKp/MapSizeY
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarKp/MapSizeX
      # combined # update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculate
      Demand/SFS_Interp2DMap_EarKp/MapPtr */
   Rte_Call_SFS_BLEND_CP_interpolate2DMap(EarSpdIndex, EarSpdFraction, (uint8)
    VEHICLE_SPEED_BRKPTS_MAP_SIZE, var_AR_CD_RackPosnCtrlErrPrelookup.EarRackPosnCtrlErrIndex,
    var_AR_CD_RackPosnCtrlErrPrelookup.EarRackPosnCtrlErrFraction, (uint8)
    EAR_RACK_POSN_BRKPTS_MAP_SIZE, (const Float32 *) &(Rte_CData_EAR_KP_MAP()->TUNE0[0][0]),
    &interpolatedTune_d);

   /* update(s) for inport ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_
      ArCtrlr/EarRackPosnCtrlErrSign */
   var_AR_CD_ArCtrlr.EarRackPosnCtrlErrSign = (float32) var_AR_CD_RackVDmd.EarRackPosnCtrlErrSign;

   /* call of function: ActiveReturnSwc_calculateDemand_tl/ActiveReturnSwc_calculateDemand/AR_CD_ArC
      trlr
      # combined # BusInport: ActiveReturnSwc_calculateDemand_tl/R_RACK_DATA_RackVelocity */
   AR_CD_ArCtrlr(interpolatedTune_a,
    Rte_IRead_ActiveReturnSwc_calculateDemand_RACK_DATA_RackVelocity()->Value,
    var_AR_CD_ActvnMgr.EarActvn, var_AR_CD_ActvnMgr.EarRampFac, ArLimit, interpolatedTune_d);

   /* # combined # TargetLink outport: ActiveReturnSwc_calculateDemand_tl/W_FITNESS_ControllerFitnes
      s */
   Rte_IWrite_ActiveReturnSwc_calculateDemand_FITNESS_ControllerFitness(QF_UNINITIALIZED);

   /* BusOutport: ActiveReturnSwc_calculateDemand_tl/W_DMD_AssistanceTorque */
   AssistanceTorque.Value = var_AR_CD_ArCtrlr.EarTqDmd;
   AssistanceTorque.Qf = QF_UNINITIALIZED;
   Rte_IWrite_ActiveReturnSwc_calculateDemand_DMD_AssistanceTorque((const tAssistTorque *)
    &AssistanceTorque);

   /* # combined # TargetLink outport: ActiveReturnSwc_calculateDemand_tl/EarARBActvnReq */
   Rte_IWrite_ActiveReturnSwc_calculateDemand_ARB_REQ_ActivationRequest((sint32)
    var_AR_CD_ActvnMgr.EarARBActvnReq);
}

#define ActiveReturnSwc_STOP_SEC_CODE
#include "ActiveReturnSwc_MemMap.h"

/*----------------------------------------------------------------------------*\
  MODULE LOCAL FUNCTION DEFINITIONS
\*----------------------------------------------------------------------------*/
#endif /* ACTIVERETURNSWC_CALCULATEDEMAND_C */
/*----------------------------------------------------------------------------*\
  END OF FILE
\*----------------------------------------------------------------------------*/
